package com.htd.erp.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.Email;

import com.htd.erp.validation.BlankablePattern;


/**
 * @author Zhang Guilin
 *
 */
@Entity
public class Supplier extends NamedEntity {

	private static final long serialVersionUID = 1549586704856318671L;
	
	@Column(length = 30)
	@Size(max = 10)
	private String contact;
	
	@Column(length = 20)
	@BlankablePattern(regexp = "^1[0-9]{10}$")
	private String phone;
	
	@Column(length = 12)
	@BlankablePattern(regexp = "([0-9]{3})+-([0-9]{8})+")
	private String fax;
	
	@Column(length = 60)
	@Email
	private String email;
	
	@Column(length = 10)
	@BlankablePattern(regexp = "([0-9]{6})+")
	private String postcode;
	
	private String site;
	
	private String address;

	public String getContact() {
		return contact;
	}

	public void setContact(String contact) {
		this.contact = contact;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getFax() {
		return fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPostcode() {
		return postcode;
	}

	public void setPostcode(String postcode) {
		this.postcode = postcode;
	}

	public String getSite() {
		return site;
	}

	public void setSite(String site) {
		this.site = site;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}
}
